#include "opendevdialog.h"
#include "ui_opendevdialog.h"
#include "QFileDialog"

openDevDialog::openDevDialog(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::openDevDialog)
{
    ui->setupUi(this);
}

openDevDialog::~openDevDialog()
{
    delete ui;
}

void openDevDialog::on_buttonBox_accepted()
{
    QFileDialog *fileDialog = new QFileDialog(this);
    fileDialog->setWindowTitle("选择配置文件");
    fileDialog->setDirectory("./");
    fileDialog->setNameFilter("File(*.json)");
    fileDialog->setViewMode(QFileDialog::Detail);
    QStringList fileNames;
    if(fileDialog->exec())
    {
        fileNames = fileDialog->selectedFiles();
        if(fileNames.count() < 1)
        {
            return;
        }
        emit updateTitleText(fileNames[0]);
    }
}
